package com.guslegend.Class01_ioc.test;

import com.guslegend.Class01_ioc.HappyPlay;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author: guslegend
 * @description: 测试引用其他Bean
 * @create: 2025-04-27 10:09
 **/
public class RefBean {

    @Test
    public void testRef(){
        ApplicationContext iocContainer=
                new ClassPathXmlApplicationContext("bean1.xml");
        HappyPlay happyPlay=iocContainer.getBean("happyPlay2", HappyPlay.class);
        System.out.println(happyPlay.getHappyTime().getTime()+happyPlay.getName());
    }
}
